//
//  RecievedLukcyDetailTableViewCell.m
//  meiyinxiang
//
//  Created by 媒印象 on 16/11/2017.
//  Copyright © 2017 hbjApple. All rights reserved.
//

#import "RecievedLukcyDetailTableViewCell.h"
#import <UIImageView+WebCache.h>
@interface RecievedLukcyDetailTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconimageview;
@property (weak, nonatomic) IBOutlet UILabel *moneynumLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *backTopLayoutCons;
@property (weak, nonatomic) IBOutlet UILabel *fromLabel;

@end
@implementation RecievedLukcyDetailTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.iconimageview.contentMode = UIViewContentModeScaleAspectFill;
    self.iconimageview.layer.cornerRadius = 30;
    self.iconimageview.layer.masksToBounds = YES;
    if (IS_IPHONE_X) {
        _backTopLayoutCons.constant = 30;
    }
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setDetailViewModel:(MYXDetailViewModel *)detailViewModel{
    [self.iconimageview sd_setImageWithURL:[NSURL URLWithString:detailViewModel.userface] placeholderImage:[UIImage imageNamed:@"AppIcon"]];
    self.iconimageview.layer.cornerRadius = 30;
    self.iconimageview.layer.masksToBounds = YES;
    
    self.moneynumLabel.text = [NSString stringWithFormat:@"%.2f元",detailViewModel.smallLuckyMoneyNum.floatValue];
    self.fromLabel.text = [NSString stringWithFormat:@"%@的信息红包",detailViewModel.username];
    self.leaveMessageBtn.enabled = detailViewModel.isMessageEnable;
}
+ (RecievedLukcyDetailTableViewCell *)loadNibWithRecievedLukcyDetailCell{
    UINib *nib = [UINib nibWithNibName:@"RecievedLukcyDetailTableViewCell" bundle:[NSBundle mainBundle]];
    
    return [[nib instantiateWithOwner:nil options:nil] lastObject];
}
@end
